import requestApi from "src/erm/sscrppublic/common/components/requestApi";
import {ajax} from 'nc-lightapp-front';


let requestDomain = '';
let requestApiOverwrite = {
    ...requestApi,
    //单据模板接口

    save: (opt) => {
        ajax({
            url: opt.url || `${requestDomain}/nccloud/erm/ersetting/ShareRuleSaveAction.do`,
            data: opt.data,
            success: (data) => {
                opt.success && opt.success(data);
            }
        })
    },
    edit: (opt) => {
        ajax({
            url: opt.url || `${requestDomain}/nccloud/erm/ersetting/ShareRuleUpdateAction.do`,
            data: opt.data,
            success: (data) => {
                opt.success(data);
            }
        })
    },
    remove: (opt) => {
        ajax({
            url: opt.url || `${requestDomain}/nccloud/erm/ersetting/ShareRuleDeleteAction.do`,
            data: opt.data,
            success: (data) => {
                opt.success(data);
            }
        })
    },
    getTreeData: (opt) => {
        ajax({
            url: opt.url || `${requestDomain}/nccloud/erm/ersetting/ShareRuleListQueryAction.do`,
            data: opt.data,
            success: (data) => {
                opt.success(data);
            }
        })
    },
    getTableData: (opt) => {
        ajax({
            url: opt.url || `${requestDomain}/nccloud/erm/ersetting/ShareRuleDataQueryAction.do`,
            data: opt.data,
            success: (data) => {
                opt.success(data);
            }
        })
    },

}

export default requestApiOverwrite;
